template <typename T>
class MyVector {
 public:
  // 一组typedef
  using value_type = T;
  using pointer = T*;
  using const_pointer = const T*;
  using reference = T&;
  using const_reference = const T&;
  using size_type = std::size_t;
  using difference_type = std::ptrdiff_t;
  // 构造析构函数
  MyVector(int size = 10) {
    first_ = new value_type[size];
    last_ = first_;
    end_ = first_ + size;
  }
  ~MyVector() {
    delete[] first_;
    first_ = last_ = end_ = nullptr;
  }
  MyVector(const MyVector& rhs) {
    int size = rhs.end_ - first_;
    first_ = new value_type[size];
    int len = last_ - first_;
    for (int i = 0; i < len; ++i) {
      first_[i] = rhs.first_[i];
    }
    last_ = first_ + len;
    end_ = first_ + size;
  }
  MyVector<T> operator=(const MyVector& rhs) {
    if (this == &rhs) return *this;
    delete[] first_;

    int size = rhs.end_ - first_;
    first_ = new value_type[size];
    int len = last_ - first_;
    for (int i = 0; i < len; ++i) {
      first_[i] = rhs.first_[i];
    }
    last_ = first_ + len;
    end_ = first_ + size;
    return *this;
  }
  MyVector(const MyVector&& rhs) {
    first_ = rhs.first_;
    last_ = rhs.last_;
    end_ = rhs.end_;
    rhs.first_ = rhs.last_ = rhs.end_ = nullptr;
  }
  MyVector<T> operator=(const MyVector&& rhs) {
    first_ = rhs.first_;
    last_ = rhs.last_;
    end_ = rhs.end_;
    rhs.first_ = rhs.last_ = rhs.end_ = nullptr;
    return *this;
  }

  // 一组公共接口
  void push_back(const_reference elem) {}
  void pop_back() {}

  bool empty() const { return first_ == last_; }
  bool full() const { return last_ == endl; }
  size_type size() const { return last_ - first_; }
  size_type capacity() const { return end_ - first_; }

 private:
  void expand() { pointer new_addr = malloc }

 private:
  pointer first_;  // 指向数组有效元素的起始位置
  pointer last_;   // 指向数组中有效元素的后继位置
  pointer end_;    // 指向数组空间的后继位置
};